package com.wh.countdownlatch;

import java.util.concurrent.CountDownLatch;

public class FirstExe implements Runnable {

	private CountDownLatch countDownLatch;
	
	public FirstExe(CountDownLatch countDownLatch) {
		this.countDownLatch = countDownLatch;
	}
	
	@Override
	public void run() {
		System.out.println("模拟执行任务的时间");
		try {
			Thread.sleep(5000);
			countDownLatch.countDown();
			System.out.println("任务执行完成！");
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

}
